const Router = require('koa-router');
const router = new Router();
const tool = require('../../tools/tool')
const {db, QueryTypes} = require("../../models/db");

// 保存送货路线区域
router.post('/deliver/saveArea', async ctx => {
    let tenantId = ctx.user.tenantId;
    let path = ctx.request.body.path;
    let id = ctx.request.body.id;
    let aid = await db.models['area'].update({
        path: JSON.stringify(path),
        tenantId
    }, {
        where: {
            id: id
        }
    })
    return ctx.suc('区域保存成功', aid);
})

module.exports = router;
